﻿Imports System.IO

Module variables
    ''' <summary>
    ''' Integer représentant la version de Windows.
    ''' 5 pour Windows 2000 et xp
    ''' 6 Pour Vista et Seven
    ''' </summary>
    ''' <remarks></remarks>
    Public osversion As Single = CSng(System.Environment.OSVersion.Version.Major + (System.Environment.OSVersion.Version.Minor / 10))

    Public AppPath As String = Application.ExecutablePath.Remove(Application.ExecutablePath.LastIndexOf(Convert.ToChar(92)) + 1)
    Public ScanPath As String = AppPath & "Scan\"
    Public SilentRecording As Boolean = False
    Public RecordDuration As Integer
    Public BDDPath As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & _
                  "\ZviewTVDotNet\DataBase\"
    Public LogosPath As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & _
                    "\ZGuideTVDotNet\Logos\"
    Public VideosPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos) & _
        "\ZviewTVDotNet\"
    Public SnapshotsPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures) & _
        "\ZviewTVDotNet\"
    Public DisplayOSD As Boolean = True
    Public errorstring As String
    Public Sub PathDefinition()
        If Not Directory.Exists(LogosPath) Then
            Directory.CreateDirectory(LogosPath)
        End If
        If Not Directory.Exists(BDDPath) Then
            Directory.CreateDirectory(BDDPath)
            CreateDataBase()
        ElseIf Not File.Exists(BDDPath & "Channels.db3") Then
            CreateDataBase()
        End If
        If Not Directory.Exists(VideosPath) Then
            Directory.CreateDirectory(VideosPath)
        End If
        If Not Directory.Exists(SnapshotsPath) Then
            Directory.CreateDirectory(SnapshotsPath)
        End If

    End Sub

End Module
